Integrand size = 21, antiderivative size = 57 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {1}{8} (4 a+b) x+\frac {(4 a+b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {b \cos ^3(e+f x) \sin (e+f x)}{4 f} \]
[Out]
Time = 0.05 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3270, 393, 205, 209} \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {(4 a+b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac {1}{8} x (4 a+b)-\frac {b \sin (e+f x) \cos ^3(e+f x)}{4 f} \]
[In]
[Out]
Rule 205
Rule 209
Rule 393
Rule 3270
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {a+(a+b) x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {b \cos ^3(e+f x) \sin (e+f x)}{4 f}+\frac {(4 a+b) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f} \\ & = \frac {(4 a+b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {b \cos ^3(e+f x) \sin (e+f x)}{4 f}+\frac {(4 a+b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f} \\ & = \frac {1}{8} (4 a+b) x+\frac {(4 a+b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {b \cos ^3(e+f x) \sin (e+f x)}{4 f} \\ \end{align*}
Time = 0.12 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.81 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {4 (4 a e+4 a f x+b f x)+8 a \sin (2 (e+f x))-b \sin (4 (e+f x))}{32 f} \]
[In]
[Out]
Time = 0.60 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.70
method | result | size |
risch | \(\frac {a x}{2}+\frac {b x}{8}-\frac {\sin \left (4 f x +4 e \right ) b}{32 f}+\frac {\sin \left (2 f x +2 e \right ) a}{4 f}\) | \(40\) |
parallelrisch | \(\frac {8 \sin \left (2 f x +2 e \right ) a -\sin \left (4 f x +4 e \right ) b +16 f \left (a +\frac {b}{4}\right ) x}{32 f}\) | \(40\) |
derivativedivides | \(\frac {b \left (-\frac {\left (\cos ^{3}\left (f x +e \right )\right ) \sin \left (f x +e \right )}{4}+\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )+a \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(70\) |
default | \(\frac {b \left (-\frac {\left (\cos ^{3}\left (f x +e \right )\right ) \sin \left (f x +e \right )}{4}+\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )+a \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(70\) |
norman | \(\frac {\left (\frac {a}{2}+\frac {b}{8}\right ) x +\left (2 a +\frac {b}{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (2 a +\frac {b}{2}\right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (3 a +\frac {3 b}{4}\right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (\frac {a}{2}+\frac {b}{8}\right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {\left (4 a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}-\frac {\left (4 a -b \right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}+\frac {\left (4 a +7 b \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {\left (4 a +7 b \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{4}}\) | \(197\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.82 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {{\left (4 \, a + b\right )} f x - {\left (2 \, b \cos \left (f x + e\right )^{3} - {\left (4 \, a + b\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 150 vs. \(2 (49) = 98\).
Time = 0.20 (sec) , antiderivative size = 150, normalized size of antiderivative = 2.63 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\begin {cases} \frac {a x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a x \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {b x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {b x \cos ^{4}{\left (e + f x \right )}}{8} + \frac {b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\left (e \right )}\right ) \cos ^{2}{\left (e \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.21 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {{\left (f x + e\right )} {\left (4 \, a + b\right )} + \frac {{\left (4 \, a + b\right )} \tan \left (f x + e\right )^{3} + {\left (4 \, a - b\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{8 \, f} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.68 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {1}{8} \, {\left (4 \, a + b\right )} x - \frac {b \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac {a \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]
[In]
[Out]
Time = 13.82 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.18 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=x\,\left (\frac {a}{2}+\frac {b}{8}\right )+\frac {\left (\frac {a}{2}+\frac {b}{8}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {a}{2}-\frac {b}{8}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \]
[In]
[Out]